package cn.fintecher.pangolin.entity.mysql;

import cn.fintecher.pangolin.common.enums.Marital;
import cn.fintecher.pangolin.common.enums.Sex;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import java.util.Date;

/**
 * @Auther: xiaqun
 * @Description: 用户详情实体
 * @Date: 10:00 2019/8/13
 */

@Data
@Entity
@Table(name = "user_detail")
public class UserDetail extends BaseEntity {
    @ApiModelProperty(value = "证件号码")
    private String certificateNo;

    @ApiModelProperty(value = "年龄")
    private Integer age;

    @ApiModelProperty(value = "性别")
    @Enumerated(EnumType.STRING)
    private Sex sex;

    @ApiModelProperty(value = "籍贯")
    private String birthplace;

    @ApiModelProperty(value = "民族")
    private String nation;

    @ApiModelProperty(value = "政治面貌")
    private String politicalStatus;

    @ApiModelProperty(value = "婚姻状况")
    @Enumerated(EnumType.STRING)
    private Marital maritalStatus;

    @ApiModelProperty(value = "学历")
    private String education;

    @ApiModelProperty(value = "专业")
    private String profession;

    @ApiModelProperty(value = "毕业学校")
    private String school;

    @ApiModelProperty(value = "毕业时间")
    private Date graduationTime;

    @ApiModelProperty(value = "参加工作时间")
    private Date joinWorkTime;

    @ApiModelProperty(value = "座机号")
    private String phoneNo;

    @ApiModelProperty(value = "手机")
    private String mobileNo;

    @ApiModelProperty(value = "邮箱")
    private String email;

    @ApiModelProperty(value = "催收经验")
    private String experience;

    @ApiModelProperty(value = "前工作单位")
    private String lastEmployer;

    @ApiModelProperty(value = "紧急联系人姓名")
    private String emergencyContactName;

    @ApiModelProperty(value = "紧急联系人电话")
    private String emergencyContactNo;

    @ApiModelProperty(value = "家庭住址")
    private String homeAddress;

    @ApiModelProperty(value = "户籍地址")
    private String residenceAddress;

    @ApiModelProperty(value = "入职时间")
    private Date entryTime;

    @ApiModelProperty(value = "本单位工龄")
    private String workAge;

    @ApiModelProperty(value = "保险办理")
    private String insurance;

    @ApiModelProperty(value = "工资银行")
    private String bank;

    @ApiModelProperty(value = "工资卡号")
    private String bankCard;

    @ApiModelProperty(value = "第一次合同签订日")
    private Date firstSignDate;

    @ApiModelProperty(value = "第一次合同到期日")
    private Date firstExpireDate;

    @ApiModelProperty(value = "第二次合同签订日")
    private Date secondSignDate;

    @ApiModelProperty(value = "第二次合同到期日")
    private Date secondExpireDate;

    @ApiModelProperty(value = "第三次合同签订日")
    private Date thirdSignDate;

    @ApiModelProperty(value = "离职日期")
    private Date leaveDate;

    @ApiModelProperty(value = "离职原因")
    private String leaveReason;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "创建人ID")
    private String operatorId;

    @ApiModelProperty(value = "创建时间")
    private Date operateTime;

    @ApiModelProperty(value = "更新人ID")
    private String updaterId;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    /**
     * 处理创建人、更新人、创建时间、更新时间
     * @param id 用户ID
     * @param date 时间
     * @param b 标识 true时设置创建人和创建时间
     */
    public void process(String id, Date date, boolean b) {
        if (b) {
            this.operatorId = id;
            this.operateTime = date;
        }
        this.updaterId = id;
        this.updateTime = date;
    }
}
